<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue是什么</title>


</head>
<body>
<div id="app">
    {{ message }}<br/>
    <input v-model="message"><br/>
    <button v-on:click="reverseMessage">逆转消息</button>
</div>
<div id="app-2">
    <span v-bind:title="message">
        鼠标再此悬停几秒钟查看动态绑定信息
    </span>
</div>
<div id="app-3">
    <p v-if="seen">现在你看到我</p>
</div>
<div id="app-4">
    <ol>
        <li v-for="todo in todos">
            {{todo.text}}
        </li>
    </ol>
</div>

<script type="text/javascript" src="source/vue.js"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
        },
        methods: {
            reverseMessage: function () {
                this.message = this.message.split('').reverse().join('')

            }
        }
    })
    var app2 = new Vue({
        el: '#app-2',
        data: {
            message: '页面加载于' + new Date().toLocaleString()
        }
    })
    var app3 = new Vue({
        el: '#app-3',
        data: {
            seen: true
        }
    })
    var app4 = new Vue({
        el: '#app-4',
        data: {
            todos: [
                {text: '学习'},
                {text: '工作'},
                {text: '生活'}
            ]
        }
    })
</script>
</body>
</html>